<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang.cp_home}{if $ur_here} - {$ur_here}{/if}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="static/css/login.css" rel="stylesheet" type="text/css" />
{insert_scripts files="../js/utils.js,validator.js"}
<script language="JavaScript">
<!--
// 这里把JS用到的所有语言都赋值到这里
{foreach from=$lang.js_languages key=key item=item}
var {$key} = "{$item}";
{/foreach}
//-->
</script>
</head>
<body>
<div class="login">
	<h1><a href="../">{$option.shop_name}</a></h1>
	{if $form_act eq "forget_pwd"}
	<form action="get_password.php" method="post" name="submitAdmin" onsubmit="return validate()" class="clearfix">
		<h2>{$lang.get_newpassword}</h2>
		<p><label>{$lang.user_name}<input type="text" name="user_name" class="input" /></label></p>
		<p><label>{$lang.email}<input type="text" name="email" class="input" /></label></p>
		<p class="submit">
			<input type="submit" value="{$lang.click_button}" class="button" />
			<input type="reset" value="{$lang.reset_button}" class="button reset" />
			<input type="hidden" name="action" value="get_pwd" />
			<input type="hidden" name="act" value="forget_pwd" />
		</p>
	</form>
	{/if}
	{if $form_act eq "reset_pwd"}
	<form action="get_password.php" method="post" name="submitPwd" onsubmit="return validate2()" class="clearfix">
		<h2>{$lang.get_newpassword}</h2>
		<p><label>{$lang.enter_admin_pwd}<input type="password" name="password" class="input" /></label></p>
		<p><label>{$lang.confirm_admin_pwd}<input type="password" name="confirm_pwd" class="input" /></label></p>
		<p class="submit">
			<input type="submit" value="{$lang.click_button}" class="button" />
			<input type="reset" value="{$lang.reset_button}" class="button reset" />
			<input type="hidden" name="action" value="reset_pwd" />
			<input type="hidden" name="act" value="forget_pwd" />
			<input type="hidden" name="adminid" value="{$adminid}" />
			<input type="hidden" name="code" value="{$code}" />
		</p>
	</form>
{/if}
{literal}
<script type="text/javascript">
<!--
/**
* 检查表单输入的数据
*/
function validate()
{
  validator = new Validator("submitAdmin");
  validator.required("user_name", user_name_empty);
  validator.required("email", email_empty, 1);
  validator.isEmail("email", email_error);

  return validator.passed();
}

function validate2()
{
  validator = new Validator("submitPwd");
  validator.required("password",            admin_pwd_empty);
  validator.required("confirm_pwd",         confirm_pwd_empty);
  if (document.forms['submitPwd'].elements['confirm_pwd'].value.length > 0)
  {
    validator.eqaul("password","confirm_pwd", both_pwd_error);
  }

  return validator.passed();
}
//-->
</script>
{/literal}
</body>
</html>